const fs = require('fs')
const path = require('path')
exports.readFile = function (pathName) {
    // 相对路径转绝对路径
    pathName = path.resolve(path.resolve(), pathName)// E:\00jinxun\code\h5\node\A.js
    return new Promise((resolve, reject) => {
        // promise里面写异步代码
        fs.readFile(pathName, 'utf8', (err, data) => {
            if (err) return reject(err)
            resolve(data)
        })
    })
}

